begin

   yy = getenv("yy")

   ;;...................................................... 
   ;; Input files 
   ;;...................................................... 
   fna = "ar5_mam3_so2_elev_2000_c090726.nc"
   fno = "emis_CAM5_monthly_so2_"+yy+"_2x2.5.nc"

   fla = addfile(fna,"r") 

   lat = fla->lat
   lon = fla->lon
   date = fla->date
   altitude = fla->altitude
   altitude_int = fla->altitude_int

   ;;...................................................... 
   ;; set date
   ;;...................................................... 

   load "date_monthly.ncl"

   ;;...................................................... 
   ;; output number data 
   ;;...................................................... 

   print("output file : "+fno)
   print(" ")
   print(" ")

   system("rm "+fno)

   flo = addfile(fno,"c")

   v1 = fla->forestfire
   v2 = fla->grassfire
   v4 = fla->emiss_ene
   v5 = fla->emiss_ind
   v6 = fla->contvolc

   flo->forestfire=v1
   flo->grassfire=v2
   flo->emiss_ene=v4
   flo->emiss_ind=v5
   flo->contvolc=v6
   flo->lat=lat
   flo->lon=lon
   flo->date=date
   flo->altitude=altitude
   flo->altitude_int=altitude_int

   ;;......................................................
   ;; create global attributes of the file
   ;;......................................................
   fAtt               = True            
   fAtt@Author        = "Kai Zhang (kai.zhang@pnnl.gov)"
   fAtt@Source        = "GFED3.1 fire emission data and CAM5 input files"
   fAtt@creation_date = systemfunc ("date")
   fileattdef( flo, fAtt )

end


